//
//  StaffCell.m
//  ios-supplier
//
//  Created by feynmanyuan on 15/4/17.
//  Copyright (c) 2015年 feynmanyuan. All rights reserved.
//

#import "StaffCell.h"

@interface StaffCell()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *mobileLabel;
@property (weak, nonatomic) IBOutlet UILabel *moRenLabel;

@property (weak, nonatomic) IBOutlet UIButton *deleteBtn;



@property (nonatomic, assign) NSUInteger staffID;
@end
@implementation StaffCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    [self.deleteBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    
}


-(void)setStaff:(JFBStaffDS *)staff{
    self.nameLabel.text = staff.name;
    self.mobileLabel.text = staff.telephone;
    self.staffID = staff.Id;
    if (staff.isDefault == 1) {
        self.moRenLabel.text = @"默认";
    }else{
        self.moRenLabel.text = @"";
    }
}

-(void)btnClick:(id)inSender {
    [[NSNotificationCenter defaultCenter] postNotificationName:@"staffListBtnClick" object:self userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%lu", (unsigned long)self.staffID] forKey:@"staffID"]];
    NSLog(@".................................................................");
}
@end
